/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "adm_datos_globales")
@NamedQueries({
    @NamedQuery(name = "AdmDatosGlobales.findAll", query = "SELECT a FROM AdmDatosGlobales a")})
public class AdmDatosGlobales implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_datos_globales")
    private Short idDatosGlobales;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 32)
    @Column(name = "clave")
    private String clave;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 512)
    @Column(name = "valor")
    private String valor;
    @Size(max = 32)
    @Column(name = "tipo")
    private String tipo;
    @Size(max = 512)
    @Column(name = "descripcion")
    private String descripcion;
    @Column(name = "estado")
    private Short estado;
    @JoinColumn(name = "id_sistema", referencedColumnName = "id_sistema")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private AdmSistema admSistema;

    public AdmDatosGlobales() {
    }

    public AdmDatosGlobales(Short idDatosGlobales) {
        this.idDatosGlobales = idDatosGlobales;
    }

    public AdmDatosGlobales(Short idDatosGlobales, String clave, String valor) {
        this.idDatosGlobales = idDatosGlobales;
        this.clave = clave;
        this.valor = valor;
    }

    public Short getIdDatosGlobales() {
        return idDatosGlobales;
    }

    public void setIdDatosGlobales(Short idDatosGlobales) {
        this.idDatosGlobales = idDatosGlobales;
    }

    public String getClave() {
        return clave;
    }

    public void setClave(String clave) {
        this.clave = clave;
    }

    public String getValor() {
        return valor;
    }

    public void setValor(String valor) {
        this.valor = valor;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Short getEstado() {
        return estado;
    }

    public void setEstado(Short estado) {
        this.estado = estado;
    }

    public AdmSistema getAdmSistema() {
        return admSistema;
    }

    public void setAdmSistema(AdmSistema admSistema) {
        this.admSistema = admSistema;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDatosGlobales != null ? idDatosGlobales.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AdmDatosGlobales)) {
            return false;
        }
        AdmDatosGlobales other = (AdmDatosGlobales) object;
        if ((this.idDatosGlobales == null && other.idDatosGlobales != null) || (this.idDatosGlobales != null && !this.idDatosGlobales.equals(other.idDatosGlobales))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.AdmDatosGlobales[ idDatosGlobales=" + idDatosGlobales + " ]";
    }
    
}
